package com.example.android.extensions

import androidx.fragment.app.Fragment
import com.example.android.ServicesObject
import com.example.android.utils.MyDialog
import com.google.android.material.snackbar.Snackbar
import com.tapadoo.alerter.Alerter

val Fragment.Services: ServicesObject
    get() =  requireActivity().Services

fun Fragment.Alert(message: String,
                   duration: Int = Snackbar.LENGTH_SHORT,
                   setAlerter: (alerter: Snackbar) -> Unit = { }) {
    requireActivity().Alert(message, duration, setAlerter)
}

fun Fragment.AlertBar(setAlerter: (alerter: Alerter) -> Unit) {
    requireActivity().AlertBar(setAlerter)
}

fun Fragment.AlertDialog(setDialog: (dialog: MyDialog) -> Unit) {
    requireActivity().AlertDialog(setDialog)
}